package com.holyant.goods.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @Author: Ssw
 * @CreateTime: 2022-12-12  14:49
 * @Description:
 */


@AllArgsConstructor
@Getter
public enum GdsCustomsTypeEnum {


    CROSS_BORDER(10,"跨境"),
    INTERNATIONAL_TRADE(20,"国贸"),
    ;

    private final Integer code;
    private final String name;


    public static String getNameByCode(Integer code ){

        return Stream.of(GdsCustomsTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().map(GdsCustomsTypeEnum::getName).orElse("");
    }
}
